public class GA {

    public static void main(String[] args) {

    	
    	int population =  (int) Math.pow(2, 7);
    	
        // Set a candidate solution
        FitnessCalc.setSolution("1110000000110001111");

        // Create an initial population
        Population myPop = new Population(population, true);
        
        // Evolve our population until we reach an optimum solution
        int generationCount = 0;
        while (generationCount < myPop.getNbIteration()) {
            generationCount++;
            System.out.println("Generation: " + generationCount + " Fittest: " + myPop.getFittest().getFitness());
            myPop = Algorithm.evolvePopulation(myPop);
        }
        System.out.println("D1 : "+myPop.getIndividual(0).getD1());
        System.out.println("D2 : "+myPop.getIndividual(0).getD2());
        System.out.println("D3 : "+myPop.getIndividual(0).getD3());
        System.out.println("Solution found!");
        System.out.println("Generation: " + generationCount);
        System.out.println("Genes:");
        System.out.println(myPop.getFittest());
        
        Fenetre fen = new Fenetre();
        fen.pack();
        fen.setVisible(true);
        
        
        
        
    }
    
}